package com.example.musicplayer.bean;

import android.os.Parcel;
import android.os.Parcelable;

public class Music implements Parcelable {

    private long id;

    private byte[] data;

    private long size;

    private String displayName;

    private String title;

    private long dateAdded;

    private long dateModified;

    private String mimeType;

    private String titleKey;

    private long duration;

    private long bookmark;

    private long artistId;

    private String artist;

    private String artistKey;

    private String composer;

    private long albumId;

    private String album;

    private String albumKey;

    private String track;

    private int year;

    private int isMusic;

    private int isPodcast;

    private int isRingTone;

    private int isAlarm;

    private int isNotification;

    public Music() {

    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public byte[] getData() {
        return data;
    }

    public void setData(byte[] data) {
        this.data = data;
    }

    public long getSize() {
        return size;
    }

    public void setSize(long size) {
        this.size = size;
    }

    public String getDisplayName() {
        return displayName;
    }

    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public long getDateAdded() {
        return dateAdded;
    }

    public void setDateAdded(long dateAdded) {
        this.dateAdded = dateAdded;
    }

    public long getDateModified() {
        return dateModified;
    }

    public void setDateModified(long dateModified) {
        this.dateModified = dateModified;
    }

    public String getMimeType() {
        return mimeType;
    }

    public void setMimeType(String mimeType) {
        this.mimeType = mimeType;
    }

    public String getTitleKey() {
        return titleKey;
    }

    public void setTitleKey(String titleKey) {
        this.titleKey = titleKey;
    }

    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    public long getBookmark() {
        return bookmark;
    }

    public void setBookmark(long bookmark) {
        this.bookmark = bookmark;
    }

    public long getArtistId() {
        return artistId;
    }

    public void setArtistId(long artistId) {
        this.artistId = artistId;
    }

    public String getArtist() {
        return artist;
    }

    public void setArtist(String artist) {
        this.artist = artist;
    }

    public String getArtistKey() {
        return artistKey;
    }

    public void setArtistKey(String artistKey) {
        this.artistKey = artistKey;
    }

    public String getComposer() {
        return composer;
    }

    public void setComposer(String composer) {
        this.composer = composer;
    }

    public long getAlbumId() {
        return albumId;
    }

    public void setAlbumId(long albumId) {
        this.albumId = albumId;
    }

    public String getAlbum() {
        return album;
    }

    public void setAlbum(String album) {
        this.album = album;
    }

    public String getAlbumKey() {
        return albumKey;
    }

    public void setAlbumKey(String albumKey) {
        this.albumKey = albumKey;
    }

    public String getTrack() {
        return track;
    }

    public void setTrack(String track) {
        this.track = track;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public int getIsMusic() {
        return isMusic;
    }

    public void setIsMusic(int isMusic) {
        this.isMusic = isMusic;
    }

    public int getIsPodcast() {
        return isPodcast;
    }

    public void setIsPodcast(int isPodcast) {
        this.isPodcast = isPodcast;
    }

    public int getIsRingTone() {
        return isRingTone;
    }

    public void setIsRingTone(int isRingTone) {
        this.isRingTone = isRingTone;
    }

    public int getIsAlarm() {
        return isAlarm;
    }

    public void setIsAlarm(int isAlarm) {
        this.isAlarm = isAlarm;
    }

    public int getIsNotification() {
        return isNotification;
    }

    public void setIsNotification(int isNotification) {
        this.isNotification = isNotification;
    }

    public Music(Parcel in) {
        id = in.readLong();
        int length = in.readInt();
        if (length > 0) {
            data = new byte[length];
            in.readByteArray(data);
        } else {
            data = null;
        }
        size = in.readLong();
        displayName = in.readString();
        title = in.readString();
        dateAdded = in.readLong();
        dateModified = in.readLong();
        mimeType = in.readString();
        titleKey = in.readString();
        duration = in.readLong();
        bookmark = in.readLong();
        artistId = in.readLong();
        artist = in.readString();
        artistKey = in.readString();
        composer = in.readString();
        albumId = in.readLong();
        album = in.readString();
        albumKey = in.readString();
        track = in.readString();
        year = in.readInt();
        isMusic = in.readInt();
        isPodcast = in.readInt();
        isRingTone = in.readInt();
        isAlarm = in.readInt();
        isNotification = in.readInt();
    }

    public static final Parcelable.Creator<Music> CREATOR = new Creator<Music>() {

        @Override
        public Music[] newArray(int size) {
            return new Music[size];
        }

        @Override
        public Music createFromParcel(Parcel source) {
            return new Music(source);
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(id);
        if (data != null && data.length > 0) {
            dest.writeInt(data.length);
            dest.writeByteArray(data);
        } else {
            dest.writeInt(0);
        }
        dest.writeLong(size);
        dest.writeString(displayName);
        dest.writeString(title);
        dest.writeLong(dateAdded);
        dest.writeLong(dateModified);
        dest.writeString(mimeType);
        dest.writeString(titleKey);
        dest.writeLong(duration);
        dest.writeLong(bookmark);
        dest.writeLong(artistId);
        dest.writeString(artist);
        dest.writeString(artistKey);
        dest.writeString(composer);
        dest.writeLong(albumId);
        dest.writeString(album);
        dest.writeString(albumKey);
        dest.writeString(track);
        dest.writeInt(year);
        dest.writeInt(isMusic);
        dest.writeInt(isPodcast);
        dest.writeInt(isRingTone);
        dest.writeInt(isAlarm);
        dest.writeInt(isNotification);
    }
}
